<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>标题元素选择</title>
		<link rel="stylesheet" type="text/css" href="css/txt.css" />
		<script src="js/jquery.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body>
		<table border="1px" cellpadding="5px" cellspacing="0px">
			<div>
				<h1>www.mldn.cn</h1>
				<h2>www.mldn.com</h2>
				<span class="temp">www.baidu.com</span>
			</div>
		</table>

	</body>

	<script type="text/javascript">
		$(function() {
			// 设置hx的元素样式为txt
			$(":header").attr("class","txt");
		});
	</script>

</html>